// 路由懒加载
import React from 'react'

const Main = React.lazy(() => import('../pages/Main'))

const Position = React.lazy(() => import('../pages/Position'))
const Have = React.lazy(() => import('../pages/Have'))
const Meassage = React.lazy(() => import('../pages/Meassage'))
const My = React.lazy(() => import('../pages/My'))
const Detail  = React.lazy(() => import('../pages/Detail'))

// 错误页面
const Err404 = React.lazy(() => import('../pages/Error/404'))


export const footerList = [
    {
        path: '/main/position',
        element: <Position/>,
        name: '职位',
        icon: <i className="iconfont icon-gongwenbao"></i>
    },
    {
        path: '/main/have',
        element: <Have/>,
        name: '有了',
        icon: <i className="iconfont icon-bixin"></i>

    },{
        path: '/main/meassage',
        element: <Meassage/>,
        name: '消息',
        icon: <i className="iconfont icon-xiaoxitongzhi"></i>

    }
    ,{
        path: '/main/my',
        element: <My/>,
        name: '我的',
        icon: <i className="iconfont icon-shouye"></i>

    }
]

const routes = [
    {
        path: '/main',
        element: <Main/>,
        children: footerList
    },
    {
        path: '/404',
        element: <Err404/>
    },
    {
        path: '/detail/:id',
        element: <Detail/>
    },
    {
        from: '/',
        to:"/main/position"
    }
]

export default routes